<template>
  <div>
    <el-dialog :title="title" :close-on-click-modal="false" v-dialogDrag :visible.sync="visible">
      <el-steps :active="active" align-center>
        <el-step title="基本信息"></el-step>
        <el-step title="地址信息"></el-step>
      </el-steps>
      <br />
      <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"
        :disabled="method==='view'" label-width="120px">
        <el-row :gutter="15">
          <div v-show="active==1" style="margin-top: 20px;">
            <el-col :span="12">
              <el-form-item label="用户" prop="user.id" :rules="[
                  {required: true, message:'用户ID不能为空', trigger:'blur'}
                 ]">
                <GridSelect title="选择用户" labelName='nikeName' labelValue='id' :value="inputForm.user.id" :limit="1"
                  @getValue='(value) => {inputForm.user.id=value}' :columns="[
            {
              prop: 'id',
              label: '主键'
            },
            {
              prop: 'phone',
              label: '手机号(账号唯一)'
            },
            {
              prop: 'nikeName',
              label: '昵称'
            }
            ]" :searchs="[
            {
              prop: 'phone',
              label: '手机号(账号唯一)'
            }
            ]" dataListUrl="/userinfo/tUserInfo/list" entityBeanName="tUserInfo"
                  queryEntityUrl="/userinfo/tUserInfo/queryById">
                </GridSelect>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="门店名称" prop="storeName" :rules="[
                  
                 ]">
                <el-input v-model="inputForm.storeName" placeholder="请填写门店名称"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="门店类型" prop="storeType" :rules="[
                 ]">
                <el-select v-model="inputForm.storeType" placeholder="请选择" style="width: 100%;">
                  <el-option label="4S" value="1">4S</el-option>
                  <el-option label="汽贸店" value="2">汽贸店</el-option>
                  <el-option label="美容装饰" value="3">美容装饰</el-option>
                  <el-option label="维修保养" value="4">维修保养</el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="门店联系电话" prop="storeContactNumber" :rules="[
                 ]">
                <el-input v-model="inputForm.storeContactNumber" placeholder="请填写门店联系电话"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="法人姓名" prop="legalName" :rules="[
                 ]">
                <el-input v-model="inputForm.legalName" placeholder="请填写法人姓名"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="联系人手机号" prop="contactPhoneNumber" :rules="[
                  
                 ]">
                <el-input v-model="inputForm.contactPhoneNumber" placeholder="请填写联系人手机号"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="门店介绍" prop="storeIntroduction" :rules="[
                 ]">
                <el-input type="textarea" v-model="inputForm.storeIntroduction" placeholder="请填写门店介绍"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="门店封面图片" prop="storeCoverImage" :rules="[
                 ]">
                <el-upload ref="storeCoverImage" v-if="visible" list-type="picture-card"
                  :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/distributor/vDistributor`"
                  :headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
                       showImg(file.url)
                    }" :on-success="(response, file, fileList) => {
                       inputForm.storeCoverImage = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }" :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.storeCoverImage = fileList.map(item => item.url).join('|')
                    }" :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }" multiple :limit="5" :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }" :file-list="storeCoverImageArra">
                  <i class="el-icon-plus"></i>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="营业执照" prop="businessLicense" :rules="[
                 ]">
                <el-upload ref="businessLicense" v-if="visible" list-type="picture-card"
                  :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/distributor/vDistributor`"
                  :headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
                        showImg(file.url)
                    }" :on-success="(response, file, fileList) => {
                       inputForm.businessLicense = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }" :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.businessLicense = fileList.map(item => item.url).join('|')
                    }" :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }" multiple :limit="5" :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }" :file-list="businessLicenseArra">
                  <i class="el-icon-plus"></i>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="法人身份证（信息页）" prop="legalIdcardJust" :rules="[
                 ]">
                <el-upload ref="legalIdcardJust" v-if="visible" list-type="picture-card"
                  :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/distributor/vDistributor`"
                  :headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
                       showImg(file.url)
                    }" :on-success="(response, file, fileList) => {
                       inputForm.legalIdcardJust = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }" :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.legalIdcardJust = fileList.map(item => item.url).join('|')
                    }" :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }" multiple :limit="5" :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }" :file-list="legalIdcardJustArra">
                  <i class="el-icon-plus"></i>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="法人身份证（国徽页）" prop="legalIdcardBack" :rules="[
                 ]">
                <el-upload ref="legalIdcardBack" v-if="visible" list-type="picture-card"
                  :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/distributor/vDistributor`"
                  :headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
                       showImg(file.url)
                    }" :on-success="(response, file, fileList) => {
                       inputForm.legalIdcardBack = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }" :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.legalIdcardBack = fileList.map(item => item.url).join('|')
                    }" :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }" multiple :limit="5" :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }" :file-list="legalIdcardBackArra">
                  <i class="el-icon-plus"></i>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="个人身份证（信息页）" prop="personalIdcardJust" :rules="[
                 ]">
                <el-upload ref="personalIdcardJust" v-if="visible" list-type="picture-card"
                  :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/distributor/vDistributor`"
                  :headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
                        showImg(file.url)
                    }" :on-success="(response, file, fileList) => {
                       inputForm.personalIdcardJust = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }" :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.personalIdcardJust = fileList.map(item => item.url).join('|')
                    }" :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }" multiple :limit="5" :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }" :file-list="personalIdcardJustArra">
                  <i class="el-icon-plus"></i>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="个人身份证（国徽页）" prop="personalIdcardBack" :rules="[
                 ]">
                <el-upload ref="personalIdcardBack" v-if="visible" list-type="picture-card"
                  :action="`${this.$http.BASE_URL}/sys/file/webupload/upload?uploadPath=/distributor/vDistributor`"
                  :headers="{token: $cookie.get('token')}" :on-preview="(file, fileList) => {
                       showImg(file.url)
                    }" :on-success="(response, file, fileList) => {
                       inputForm.personalIdcardBack = fileList.map(item => (item.response && item.response.url) || item.url).join('|')
                    }" :on-remove="(file, fileList) => {
                      $http.post(`/sys/file/webupload/deleteByUrl?url=${(file.response && file.response.url) || file.url}`).then(({data}) => {
                        $message.success(data.msg)
                      })
                      inputForm.personalIdcardBack = fileList.map(item => item.url).join('|')
                    }" :before-remove="(file, fileList) => {
                      return $confirm(`确定移除 ${file.name}？`)
                    }" multiple :limit="5" :on-exceed="(files, fileList) =>{
                      $message.warning(`当前限制选择 5 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`)
                    }" :file-list="personalIdcardBackArra">
                  <i class="el-icon-plus"></i>
                </el-upload>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="12">
            <el-form-item label="营业开始时间" prop="openingTime"
                :rules="[
                 ]">
                <el-date-picker
                      style="width: 100%;"
                      v-model="inputForm.openingTime"
                      type="time"
                      value-format="HH:mm:ss"
                      placeholder="选择日期时间">
                    </el-date-picker>
           </el-form-item>
        </el-col>
        <el-col :span="12">
            <el-form-item label="营业结束时间" prop="closingTime"
                :rules="[
                 ]">
                <el-date-picker
                      style="width: 100%;"
                      v-model="inputForm.closingTime"
                      type="time"
                      value-format="HH:mm:ss"
                      placeholder="选择日期时间">
                    </el-date-picker>
           </el-form-item>
        </el-col> -->
            <!-- <el-col :span="12">
            <el-form-item label="审核状态（0：待审核，1：已通过，2：已拒绝）" prop="auditStatus"
                :rules="[
                 ]">
                <el-select v-model="inputForm.auditStatus" placeholder="请选择"  style="width: 100%;">
                          <el-option
                            v-for="item in $dictUtils.getDictList('')"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                          </el-option>
                      </el-select>
           </el-form-item>
        </el-col> -->
            <el-col :span="12" v-if="inputForm.auditStatus==2">
              <el-form-item label="拒绝原因" prop="reasonRejection" :rules="[
                 ]">
                <el-input type="textarea" v-model="inputForm.reasonRejection" placeholder="请填写拒绝原因"></el-input>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="12">
            <el-form-item label="是否冻结（0：未冻结，1：已冻结）" prop="isFrozen"
                :rules="[
                 ]">
                    <el-radio-group v-model="inputForm.isFrozen">
                        <el-radio v-for="item in $dictUtils.getDictList('')" :label="item.value" :key="item.id">{{item.label}}</el-radio>
                    </el-radio-group>
           </el-form-item>
        </el-col> -->
            <el-col :span="24">
              <el-form-item label="备注信息" prop="remarks" :rules="[
                 ]">
                <el-input type="textarea" v-model="inputForm.remarks" placeholder="请填写备注信息"></el-input>
              </el-form-item>
            </el-col>
          </div>
          <div v-show="active==2" style="margin-top: 20px;">
            <el-col :span="12">
              <el-form-item label="办公区域" prop="officeArea" :rules="[
                 ]">
                <el-select v-model="inputForm.officeArea" placeholder="请选择类型" size="small" style="width: 100%;">
                  <el-option v-for="item in valueList" :key="item.valueName" :label="item.valueName"
                    :value="item.valueName">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="办公地址" prop="officeAddress" :rules="[
                 ]">
                <el-input v-model="inputForm.officeAddress" ref="handleinput" id="handleinput" placeholder="请填写办公地址">
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="经度" prop="longitude" :rules="[
                 ]">
                <el-input v-model="inputForm.longitude" placeholder="请填写经度"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="纬度" prop="latitude" :rules="[
                 ]">
                <el-input v-model="inputForm.latitude" placeholder="请填写纬度"></el-input>
              </el-form-item>
            </el-col>
            <el-col>
              <el-form-item label="地图" prop="">
                <div ref="container" id="containepic"></div>
              </el-form-item>
            </el-col>
          </div>
        </el-row>
      </el-form>
      <!-- <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
      <el-button type="primary" v-if="method != 'view'" @click="doSubmit()" v-noMoreClick>确定</el-button>
    </span> -->
      <span slot="footer" class="dialog-footer">
        <el-button v-if="active !== 1" style="margin-top: 12px;" @click="upper">上一步</el-button>
        <el-button v-if="active !== 2" style="margin-top: 12px;" @click="next">下一步</el-button>
        <el-button v-if="method == 'view' && inputForm.auditStatus == 0" style="margin-top: 12px;"
          @click="audit(inputForm.id,1)">通过</el-button>
        <el-button v-if="method == 'view' && inputForm.auditStatus == 0" style="margin-top: 12px;"
          @click="jj(inputForm.id,2)">拒绝</el-button>
        <el-button @click="visible = false">关闭</el-button>
        <el-button type="primary" v-if="method != 'view'" @click="doSubmit()" v-noMoreClick>确定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
  import GridSelect from "@/components/gridSelect";
  export default {
    data() {
      return {
        title: "",
        method: "",
        active: 1,
        visible: false,
        loading: false,
        storeCoverImageArra: [],
        businessLicenseArra: [],
        legalIdcardJustArra: [],
        legalIdcardBackArra: [],
        personalIdcardJustArra: [],
        personalIdcardBackArra: [],
        inputForm: {
          id: "",
          user: {
            id: "",
          },
          storeName: "",
          storeType: "",
          storeIntroduction: "",
          officeArea: "",
          officeAddress: "",
          longitude: "",
          latitude: "",
          storeContactNumber: "",
          legalName: "",
          contactPhoneNumber: "",
          storeCoverImage: "",
          businessLicense: "",
          legalIdcardJust: "",
          legalIdcardBack: "",
          personalIdcardJust: "",
          personalIdcardBack: "",
          openingTime: "",
          closingTime: "",
          auditStatus: "",
          reasonRejection: "",
          isFrozen: "",
          remarks: "",
        },
        markersArray: [],
        url: "",
        urlData: [],
        radio: "2",
        valueList: [],
      };
    },
    components: {
      GridSelect,
    },
    activated() {
      this.getvalueList();
    },
    methods: {
      showImg(url) {
        this.$hevueImgPreview(url);
      },
      audit(id, status) {
        this.$confirm(`确定当前操作?`, "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }).then(() => {
          this.loading = true;
          this.$http({
            url: "/distributor/vDistributor/audit",
            method: "post",
            params: { id: id, auditStatus: status },
          }).then(({ data }) => {
            if (data && data.success) {
              this.inputForm.auditStatus = '1',
               this.visible = false
              this.$message.success(data.msg);
              this.$parent.refreshList();
            }
            this.loading = false;
          });
        });
      },
      jj(id, status) {
        this.$prompt("请输入拒绝原因", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
        })
          .then(({ value }) => {
            if (!value){
              this.$message.error("请输入拒绝原因");
              return false
            }
            this.loading = true;
            this.$http({
              url: "/distributor/vDistributor/audit",
              method: "post",
              params: { id: id, auditStatus: status, reasonRejection: value },
            }).then(({ data }) => {
              if (data && data.success) {
                this.inputForm.auditStatus = '2',
                 this.visible = false
                this.$message.success(data.msg);
                this.$parent.refreshList();
              }
              this.loading = false;
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "取消输入",
            });
          });
      },
      // 获取数据列表
      getvalueList() {
        this.$http({
          url: "/valueinfo/tValueInfo/list",
          method: "get",
          params: {
            pageNo: 1,
            pageSize: 999,
            orderBy: this.orderBy,
            type: 7,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.valueList = data.page.list;
          }
        });
      },
      initMap(longitude, latitude) {
        var that = this;
        let address = "";
        let lat = "36.752508224779746";
        let logt = "119.97121810913086";
        if (!longitude) {
          let lat = latitude;
          let logt = longitude;
        }
        if (this.inputForm.latitude === "") {
          var center = new qq.maps.LatLng(lat, logt);
        } else {
          var center = new qq.maps.LatLng(
            this.inputForm.latitude,
            this.inputForm.longitude
          );
        }
        var map = new qq.maps.Map(document.getElementById("containepic"), {
          center: center,
          zoom: 13,
          disableDefaultUI: true,
        });
        var marker = new qq.maps.Marker({
          position: center,
          map: map,
        });
        that.markersArray.push(marker);
        var infoWin = new qq.maps.InfoWindow({
          map: map,
        }); //此处是点击地图后生成的地标名称
        var geocoder = new qq.maps.Geocoder({
          complete: function (res) {
            that.deleteOverlays();
            map.setCenter(res.detail.location);
            var marker = new qq.maps.Marker({
              map: map,
              position: res.detail.location,
            });
            that.markersArray.push(marker);
          },
        });

        qq.maps.event.addListener(map, "click", function (event) {
          that.deleteOverlays();
          // this.latitude = event.latLng.getLat();
          // this.longiistude = event.latLng.getLng();
          // console.log(this.longiistude, this.latitude);
          that.inputForm.longitude = event.latLng.getLng();
          that.inputForm.latitude = event.latLng.getLat();
          var position = new qq.maps.LatLng(
            that.inputForm.latitude,
            that.inputForm.longitude
          );
          var marker = new qq.maps.Marker({
            map: map,
            position: position,
          });
          that.markersArray.push(marker);
        });
        document
          .getElementById("handleinput")
          .addEventListener("blur", function () {
            console.log("1111");
            geocoder.getLocation(that.inputForm.officeAddress);
          });
      },
      deleteOverlays() {
        if (this.markersArray) {
          for (var i in this.markersArray) {
            this.markersArray[i].setMap(null);
          }
          this.markersArray.length = 0;
        }
      },
      init(method, id) {
        this.active = 1;
        this.method = method;
        this.inputForm.id = id;
        if (method === "add") {
          this.title = `新建经销商信息`;
        } else if (method === "edit") {
          this.title = "修改经销商信息";
        } else if (method === "view") {
          this.title = "查看经销商信息";
        }
        this.imageArra = [];
        this.storeCoverImageArra = [];
        this.businessLicenseArra = [];
        this.legalIdcardJustArra = [];
        this.legalIdcardBackArra = [];
        this.personalIdcardJustArra = [];
        this.personalIdcardBackArra = [];
        this.visible = true;
        this.loading = false;
        this.$nextTick(() => {
          this.$refs.inputForm.resetFields();
          if (method === "edit" || method === "view") {
            // 修改或者查看
            this.loading = true;
            this.$http({
              url: `/distributor/vDistributor/queryById?id=${this.inputForm.id}`,
              method: "get",
            }).then(({ data }) => {
              this.inputForm = this.recover(this.inputForm, data.vDistributor);
              this.initMap(this.inputForm.longitude, this.inputForm.latitude);
              this.inputForm.storeCoverImage.split("|").forEach((item) => {
                if (item.trim().length > 0) {
                  this.storeCoverImageArra.push({
                    name: decodeURIComponent(
                      item.substring(item.lastIndexOf("/") + 1)
                    ),
                    url: item,
                  });
                }
              });
              this.inputForm.businessLicense.split("|").forEach((item) => {
                if (item.trim().length > 0) {
                  this.businessLicenseArra.push({
                    name: decodeURIComponent(
                      item.substring(item.lastIndexOf("/") + 1)
                    ),
                    url: item,
                  });
                }
              });
              this.inputForm.legalIdcardJust.split("|").forEach((item) => {
                if (item.trim().length > 0) {
                  this.legalIdcardJustArra.push({
                    name: decodeURIComponent(
                      item.substring(item.lastIndexOf("/") + 1)
                    ),
                    url: item,
                  });
                }
              });
              this.inputForm.legalIdcardBack.split("|").forEach((item) => {
                if (item.trim().length > 0) {
                  this.legalIdcardBackArra.push({
                    name: decodeURIComponent(
                      item.substring(item.lastIndexOf("/") + 1)
                    ),
                    url: item,
                  });
                }
              });
              this.inputForm.personalIdcardJust.split("|").forEach((item) => {
                if (item.trim().length > 0) {
                  this.personalIdcardJustArra.push({
                    name: decodeURIComponent(
                      item.substring(item.lastIndexOf("/") + 1)
                    ),
                    url: item,
                  });
                }
              });
              this.inputForm.personalIdcardBack.split("|").forEach((item) => {
                if (item.trim().length > 0) {
                  this.personalIdcardBackArra.push({
                    name: decodeURIComponent(
                      item.substring(item.lastIndexOf("/") + 1)
                    ),
                    url: item,
                  });
                }
              });
              this.loading = false;
            });
          } else {
            this.initMap();
          }
        });
      },
      next() {
        this.active++;
        if (this.active == 1) {
          console.log(123213213213);
          // this.initMap();
        }
      },
      upper() {
        this.active--;
        if (this.active == 1) {
          console.log(123213213213);
          // this.initMap();
        }
      },
      // 表单提交
      doSubmit() {
        this.$refs["inputForm"].validate((valid) => {
          if (valid) {
            this.loading = true;
            this.$http({
              url: `/distributor/vDistributor/save`,
              method: "post",
              data: this.inputForm,
            }).then(({ data }) => {
              this.loading = false;
              if (data && data.success) {
                this.visible = false;
                this.$message.success(data.msg);
                this.$emit("refreshDataList");
              }
            });
          }
        });
      },
    },
  };
</script>
<style lang="less">
  #containepic {
    width: 750px;
    height: 500px;
  }

  .showPic .el-message-box__message {
    width: 800px;
    height: 800px;
    overflow: hidden;
    display: flex;

    p img {
      height: 100% !important;
      width: 100% !important;
      object-fit: contain;
    }
  }

  .imgstyle {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
</style>